/*
 * File      : app.c
 * This file is part of RT-Thread RTOS
 * COPYRIGHT (C) 2006, RT-Thread Development Team
 *
 * The license and distribution terms for this file may be
 * found in the file LICENSE in this distribution or at
 * http://openlab.rt-thread.com/license/LICENSE
 *
 * Change Logs:
 * Date           Author       Notes
 * 2010-08-28     Yi.Qiu       the first version
 */

/**
 * @addtogroup LM3S
 */
/*@{*/

#include <rtthread.h>
#include "led.h"

/* thread phase init */
void rt_thread_entry_led(void *parameter)
{
    unsigned int count=0;
    while (1)
    {
        /* led1 on */
        rt_kprintf("led on,count : %d\r\n",count);
        count++;
        rt_hw_led_on();
        rt_thread_delay(50); /* sleep 0.5 second and switch to other thread */

        /* led1 off */
        rt_kprintf("led off\r\n");
        rt_hw_led_off();
        rt_thread_delay(50);
    }
}

int rt_application_init()
{
	rt_thread_t init_thread;

	init_thread = rt_thread_create("led",
								rt_thread_entry_led, RT_NULL,
								1024, 21, 20);
	rt_thread_startup(init_thread);

	return 0;
}
/*@}*/
